package cn.legend.travel.tour.team.pojo.po;


import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
@Document(indexName = "tour")
public class TourSearchPO implements Serializable {
    /**
     * 主键
     */
    @Id
    private Long id;

    /**
     * 封面
     */
    @Field(type = FieldType.Keyword)
    private String coverUrl;
    /**
     * 销量
     */
    @Field(type = FieldType.Keyword)
    private Integer saleCount;
    /**
     * 商品类型
     */
    @Field(type = FieldType.Keyword)
    private String type;
    /**
     * 出发地点
     */
    @Field(type = FieldType.Keyword)
    private String departure;
    /**
     * 标题
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String title;
    /**
     * 出发时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date startTime;
    /**
     * 结束时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    private Date endTime;
    /**
     * 关键词列表，逗号分隔
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String keywords;
    /**
     * 商家名称
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String store;
    /**
     * 基础价格
     */
    @Field(type = FieldType.Keyword)
    private BigDecimal basePrice;
    /**
     * 好评量
     */
    @Field(type = FieldType.Keyword)
    private Long likeCount;
    /**
     * 浏览量
     */
    @Field(type = FieldType.Keyword)
    private Long viewCount;
    /**
     * 消费券名称
     */
    @Field(type = FieldType.Keyword)
    private String coupon;





}
